package com.wuqi.dev.ipcdemo;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Risky57 on 2017/5/9.
 */

public class UserBean implements Parcelable{

    private long id;
    private String account;
    private String password;

    public UserBean () {
    }

    protected UserBean (Parcel in) {
        id = in.readLong();
        account = in.readString();
        password = in.readString();
    }

    public static final Creator<UserBean> CREATOR = new Creator<UserBean>() {
        @Override
        public UserBean createFromParcel (Parcel in) {
            return new UserBean(in);
        }

        @Override
        public UserBean[] newArray (int size) {
            return new UserBean[size];
        }
    };

    @Override
    public String toString () {
        return "UserBean{" +
                "id=" + id +
                ", account='" + account + '\'' +
                ", password='" + password + '\'' +
                '}';
    }

    public long getId () {
        return id;
    }

    public UserBean setId (long id) {
        this.id = id;
        return this;
    }

    public String getAccount () {
        return account;
    }

    public UserBean setAccount (String account) {
        this.account = account;
        return this;
    }

    public String getPassword () {
        return password;
    }

    public UserBean setPassword (String password) {
        this.password = password;
        return this;
    }

    @Override
    public int describeContents () {
        return 0;
    }

    @Override
    public void writeToParcel (Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeString(account);
        dest.writeString(password);
    }
}
